Substrings with slice
Use .slice() to extract substrings given two indices:
var s = "0123456789abcdefg";
s.slice(0, 5); // "01234"
s.slice(5, 6); // "5"
Given one index, it will take from that index to the end of the string:
s.slice(10); // "abcdefg"